import {
  createRouter,
  createWebHistory
} from 'vue-router'
import index from '../views/index.vue'

const routes = [{
    path: '/',
    name: 'index',
    component: index,
    children: [{
      path: '/',
      redirect: '/HomePage'
    }, {
      path: '/HomePage',
      name: 'HomePage',
      component: () => import("../views/HomePage.vue"),
    }, {
      path: '/Mine',
      name: 'Mine',
      component: () => import("../views/Mine.vue"),
    }]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register.vue')
  },
  {
    path: '/change',
    name: 'change',
    component: () => import('../views/change.vue')
  },
  {
    path: '/SearchRegistration',
    name: 'SearchRegistration',
    component: () => import("../views/SearchRegistration.vue"),
  },
  {
    path: '/RegistrationDetails',
    name: 'RegistrationDetails',
    component: () => import("../views/RegistrationDetails.vue"),
  },
  {
    path: '/Registration',
    name: 'Registration',
    component: () => import("../views/Registration.vue"),
  },
  {
    path: '/RegisterDetail',
    name: 'RegisterDetail',
    component: () => import("../views/RegisterDetail.vue"),
  },
  {
    path: '/Payment',
    name: 'Payment',
    component: () => import("../views/Payment.vue"),
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router